﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="roles.aspx.cs" Inherits="RastinArgham.CRM.Web.roles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <h3 class="ui-widget-header">
            <asp:Literal ID="lbtitle" runat="server" Text="مدیریت نقشها" />
    </h3>
    
    <div class="ui-layout-content ui-widget-content">

        <mani:PagingGridView runat="server" ID="gvRoles" Width="500" 
            AutoGenerateColumns="false" GridLines="none" DataKeyNames="RoleName" 
            onrowcreated="gvRoles_RowCreated" onrowdeleted="gvRoles_RowDeleted" 
            onrowdeleting="gvRoles_RowDeleting" 
            onselectedindexchanging="gvRoles_SelectedIndexChanging">
            <Columns>
                <asp:BoundField HeaderText="کد نقش" DataField="RoleId" />
                <asp:BoundField HeaderText="نام نقش" DataField="RoleName" />

                <asp:TemplateField>
                    <itemtemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Select">
                                <img src="/App_Themes/<%=Page.Theme %>/images/edit.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>

                <asp:TemplateField>
                    <itemtemplate>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete">
                                <img src="/App_Themes/<%=Page.Theme %>/images/delete.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>
            </Columns>
        </mani:PagingGridView>


        <div class="space"></div>
        
        <h3>ایجاد و ویرایش نقش :</h3>

        <table>
            <tr>
                <td>
                    نام نقش
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtRoleName"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvRoleName" ControlToValidate="txtRoleName" runat="server"  ErrorMessage="*" ValidationGroup="AddEditRole" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>لیست دسترسی ها</td>
                <td>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><asp:CheckBoxList ValidationGroup="AddEditRole" DataTextField="Description" DataValueField="ActionName" ID="cbRoleActions" runat="server" /></td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnSaveChanges" Text="ذخیره تغییرات" runat="server" onclick="btnSaveChanges_Click" ValidationGroup="AddEditRole" />
                </td>
            </tr>
        </table>

    </div>

</asp:Content>
